package com.jmp.security.response;

import com.jmp.security.base.*;
import lombok.extern.slf4j.Slf4j;
import one.stand.entity.TokenEntity;

@Slf4j
public class FailResponseHandlerImpl implements ResponseHandler {
    @Override
    public ResponseDetail handler(RequestDetail requestDetail, ClientDetail detail, UserDetail userDetail, TokenEntity tokenEntity, Exception e) {
        log.info("fail handler");
        log.error(e.getMessage(), e);

        return ResponseDetail.builder()
                .isSuccess(false)
                .message(e.getMessage())
                .exception(e)
                .build();
    }
}
